<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('增量返现明细列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label style="width: 100px;">服务商编号：</label>
                                <input type="text" name="agentNum"/>
                            </li>
                            <li>
                                <label style="width: 100px;">服务商名称：</label>
                                <input type="text" name="agentName"/>
                            </li>
                            <li>
                                <label style="width: 100px;">团长编号：</label>
                                <input type="text" name="parentYlId"/>
                            </li>
                            <li>
                                <label style="width: 100px;">团长名称：</label>
                                <input type="text" name="parentYlName"/>
                            </li>

                            <li>
                                <label style="width: 100px;">类型：</label>
                                <select name="type">
                                    <option value="">所有</option>
                                    <option value="1">团长</option>
                                    <option value="2">资深总监</option>
                                </select>
                            </li>
                            <li>
                                <label style="width: 100px;">返现类型：</label>
                                <select name="cycle">
                                    <option value="">所有</option>
                                    <option value="0">日返</option>
                                    <option value="1">月返</option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label style="width: 100px;">返现日期：</label>
                                <input type="text" readonly class="time-input" id="startTime" placeholder="开始时间" name="start"/>
                                <span>-</span>
                                <input type="text" readonly class="time-input" id="endTime" placeholder="结束时间" name="end"/>
                            </li>
                            <li>
                                <label style="width: 10px;"></label>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="zlCashDetails:zlCashDetails:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table" class="table text-nowrap"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('zlCashDetails:zlCashDetails:edit')}]];
        var removeFlag = [[${@permission.hasPermi('zlCashDetails:zlCashDetails:remove')}]];
        var prefix = ctx + "zlCashDetails/zlCashDetails";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "增量返现明细",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'agentNum',
                    title: '服务商编号'
                },
                {
                    field: 'agentName',
                    title: '服务商名称'
                },
                {
                    field: 'parentYlId',
                    title: '团长编号'
                },
                {
                    field: 'parentYlName',
                    title: '团长名称'
                },
                {
                    field: 'type',
                    title: '类型',
                    formatter(value,row,index){
                        if (value == '1'){
                            return "<span style='color: blue'>团长</span>";
                        } else if (value == '2'){
                            return "<span style='color: green'>资深总监</span>";
                        }

                    }
                },
                {
                    field: 'ylId',
                    title: '引流编号'
                },
                {
                    field: 'num',
                    title: '档次数量'
                },
                {
                    field: 'standard',
                    title: '档次金额',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'award',
                    title: '奖励比例'
                },
                {
                    field: 'tax',
                    title: '税点'
                },
                {
                    field: 'taxMoney',
                    title: '税额',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'returnMoney',
                    title: '返现金额',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'returnTaxMoney',
                    title: '税后返现金额',
                    formatter: function(value, row, index) {
                        return $.table.rmbFormatter(value);
                    }
                },
                {
                    field: 'returnDate',
                    title: '返现日期'
                },
                {
                    field: 'cycle',
                    title: '返现类型',
                    formatter(value,row,index){
                        if (value == '0'){
                            return "<span style='color: blue'>日返</span>";
                        } else if (value == '1'){
                            return "<span style='color: green'>月返</span>";
                        }

                    }
                },
                {
                    field: 'settleSerial',
                    title: '出款流水号'
                },
                {
                    field: 'leiMoney',
                    title: '档次*金额'
                },
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>